﻿@namespace AntDesign.Pro.Template
@inherits LayoutComponentBase

<AntDesign.Pro.Layout.BasicLayout 
    Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
    MenuData="_menuData">
    <RightContentRender>
        <RightContent />
    </RightContentRender>
    <ChildContent>
        @Body
    </ChildContent>
</AntDesign.Pro.Layout.BasicLayout>
<SettingDrawer />

@code
{
//#if (full)    
    private MenuDataItem[] _menuData = {};

    [Inject] public HttpClient HttpClient { get; set; }

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();
        _menuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
    }
//#else
    private readonly MenuDataItem[] _menuData = 
    {
        new MenuDataItem
        {
            Path = "/",
            Name = "welcome",
            Key = "welcome",
            Icon = "smile",
        }
    };
//#endif
}